﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VSmityukh.WP.TitleLocalizationTool
{
	[DebuggerDisplay("{LanguageName}: Title-[{Title}] Tile-[{TileTitle}]")]
	public class LanguageInfo
	{
		private readonly string languageName;
		private readonly string title;
		private readonly string tileTitle;
		private readonly string resourceFileName;
		private readonly bool isSupportedByWP7;
		private readonly CultureInfo cultureInfo;

		public LanguageInfo(string languageName, string title, string tileTitle)
		{
			Guard.NotNullAndWhiteSpace(languageName);
			Guard.NotNullAndEmpty(title);
			Guard.NotNullAndEmpty(tileTitle);

			if (!LocalizationHelper.IsSupported(languageName))
			{
				throw new ArgumentException("Language " + languageName + " does not supported");
			}

			this.languageName = languageName;
			this.title = title;
			this.tileTitle = tileTitle;

			resourceFileName = LocalizationHelper.GetFileName(languageName);
			isSupportedByWP7 = LocalizationHelper.IsSupportedByWP7(languageName);
			cultureInfo = LocalizationHelper.GetCulture(languageName);
		}

		public string LanguageName
		{
			get { return languageName; }
		}

		public string Title
		{
			get { return title; }
		}

		public string TileTitle
		{
			get { return tileTitle; }
		}

		public string ResourceFileName
		{
			get { return resourceFileName; }
		}

		public bool IsSupportedByWP7
		{
			get { return isSupportedByWP7; }
		}

		public CultureInfo CultureInfo
		{
			get { return cultureInfo; }
		}
	}
}
